<div class="modal-header">
    <span class="modal-title h3">添加常用应用</span>
    <a href class="iconfont icon-close pull-right" ng-click="cancel()"></a>
</div>
<div class="modal-body" ng-if="User.authority=='Developer'" style="overflow-y: scroll;">
    <form class="form-horizontal">
        <div class="form-group">
            <label class="col-sm-2 col-md-3  control-label">应用名：</label>
            <div class="col-sm-10 col-md-8">
                <input type="text" class="form-control" placeholder="应用子模块" ng-model="commonApp.appCommonlyFunctionName" required >
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 col-md-3  control-label">排序：</label>
            <div class="col-sm-10 col-md-8">
                <input type="number" class="form-control" placeholder="排序" ng-model="commonApp.appCommonlyFunctionNo" required >
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 col-md-3  control-label">常用应用域名：</label>
            <div class="col-sm-10 col-md-8">
                <input type="url" class="form-control" placeholder="请输入域名(http://www.xxx.com)" ng-model="commonApp.appCommonlyFunctionUrl" required >
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 col-md-3  control-label">常用应用图片：</label>
            <div class="col-sm-10 col-md-8">
                <input type="file" nv-file-select="" uploader="uploader3"/>
                <div ng-repeat="item in uploader3.queue">
                    <div ng-show="uploader3.isHTML5" ng-thumb="{ file: item._file, height: 44 }"></div>
                </div>
            </div>
        </div>
    </form>
</div>
<div class="modal-body" ng-if="User.authority !='Developer'" style="overflow-y:scroll;height:430px">
    <div class="table-responsive">
        <table class="table table-manager">
            <thead>
                <tr >
                    <th >
                        应用图标
                    </th>
                    <th>
                        应用名称
                    </th>
                    <th style="width:57px">
                        序号
                    </th>
                    <th>
                        应用模块名称
                    </th>
                    <th>
                        是否添加
                    </th>
                </tr>
            </thead>
            <tbody ng-repeat="item in AllCommonAppList track by $index">
                <tr class="text-center" ng-repeat="subItem in item.appCommonlyFunctionList ">
                    <td rowspan="{{item.appCommonlyFunctionList.length}}" ng-if="$index == 0">
                        <img lazy-src="{{imgApi+item.icon}}" onerror="javascript:this.src='src/imgs/img-fail.png';" alt="图标" width="38" height="38">
                    </td>
                    <td rowspan="{{item.appCommonlyFunctionList.length}}"  ng-if="$index == 0" class="text-left" >
                        {{item.appName}}
                    </td>
                    <td style="width:57px" >
                        {{subItem.appCommonlyFunctionNo}}
                    </td>
                    <td class="text-left">
                        {{subItem.appCommonlyFunctionName}}
                    </td>
                    <td >
                        <button class="btn" ng-class="{false:'btn-success',true:'btn-default'}[subItem.checked]" ng-click="AddCommonApp(subItem.id,subItem.checked)">{{subItem.checked?'移除':'添加'}}</button>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</div>
<div class="modal-footer" style="text-align:center">
    <button class="btn btn-primary" style="margin-top:10px" ng-click="ok()">　　完成　　</button>
    <button class="btn btn-default" style="margin-top:10px" ng-click="cancel()">　　取消　　</button>
</div>
